require("../../res/www.a9a.cn.js");
var o,
  n = getApp();
Page({
  data: {},
  onLoad: function (t) {
    var a = this;
    n.chklogin().then(function (o) {
      o || wx.navigateBack();
    }),
      n.get_openid().then(function (t) {
        a.setData({ color: n._ZEAI.color }),
          (o = wx.getStorageSync("COOK_U")),
          n.ajax({
            url: "my_set.php",
            data: { submitok: "init", openid: o.openid },
            success: function (o) {
              1 == o.flag
                ? a.setData({ ARR: o.ARR })
                : wx.showModal({
                    content: o.msg,
                    confirmColor: a.data.color,
                    confirmText: "朕知道了",
                    showCancel: !1,
                    success: function (o) {
                      wx.navigateBack();
                    },
                  });
            },
          });
      });
  },
  hidemyFn: function (t) {
    var a = this;
    n.ajax({
      url: "my_set.php",
      data: { submitok: "flag", openid: o.openid },
      success: function (o) {
        1 == o.flag
          ? wx.showToast({ title: o.msg, icon: "none", mask: !0 })
          : wx.showModal({
              content: o.msg,
              confirmColor: a.data.color,
              confirmText: "朕知道了",
              showCancel: !1,
              success: function (o) {
                wx.navigateBack();
              },
            });
      },
    });
  },
  hidephotoFn: function (t) {
    var a = this;
    n.ajax({
      url: "my_set.php",
      data: { submitok: "photo_ifshow", openid: o.openid },
      success: function (o) {
        1 == o.flag
          ? wx.showToast({ title: o.msg, icon: "none", mask: !0 })
          : wx.showModal({
              content: o.msg,
              confirmColor: a.data.color,
              confirmText: "朕知道了",
              showCancel: !1,
              success: function (o) {
                wx.navigateBack();
              },
            });
      },
    });
  },
  delFn: function () {
    var t = this;
    wx.showModal({
      title: "",
      content: "确定要注销帐号么？\n注销后将不能登录使用本平台，请慎重！",
      confirmColor: t.data.color,
      cancelText: "取消",
      confirmText: "确定",
      success: function (a) {
        a.confirm &&
          n.ajax({
            url: "my_set.php",
            data: { submitok: "del", openid: o.openid },
            success: function (o) {
              1 == o.flag
                ? (wx.showToast({ title: o.msg, icon: "none", mask: !0 }),
                  setTimeout(function () {
                    wx.reLaunch({ url: "../index/index4" });
                  }, 2e3))
                : wx.showModal({
                    content: o.msg,
                    confirmColor: t.data.color,
                    confirmText: "朕知道了",
                    showCancel: !1,
                    success: function (o) {
                      wx.navigateBack();
                    },
                  });
            },
          });
      },
    });
  },
});
